package com.sbl.service.impl;


import com.sbl.dao.IAccountDaoDatabaseXML;
import com.sbl.domain.Account;
import com.sbl.service.IAccountServiceDatabaseXML;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 账户的业务层实现类
 *        -  1. 数据库的配置是通过  xml  配置的
 *        -  2. 注解配置类  也是使用这个做的 测试
 */
@Service("accountServiceDatabaseXML")
public class AccountServiceDatabaseXMLImpl implements IAccountServiceDatabaseXML {

    @Autowired
    private IAccountDaoDatabaseXML accountDaoDatabaseXML;


    public List<Account> findAllAccount() {
        return accountDaoDatabaseXML.findAllAccount();
    }

    public Account findAccountById(Integer accountId) {
        return accountDaoDatabaseXML.findOneAccountById(accountId);
    }

    public void saveAccount(Account account) {
        accountDaoDatabaseXML.saveAccount(account);
    }

    public void updateAccount(Account account) {
        accountDaoDatabaseXML.updateAccount(account);
    }

    public void deleteAccount(Integer acccountId) {
        accountDaoDatabaseXML.deleteAccount(acccountId);
    }
}
